package com.hutao.medical.controller;

import java.util.List;
import java.util.Map;

import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hutao.medical.service.MedRecordService;

@Controller
@RequestMapping("/page")
public class PageController {
	
	@Autowired
	private MedRecordService medRecordService;
	
	
	@RequestMapping("/index")
	public String index(){
		return "index";
	}
	
	//ICD数据
	@RequestMapping("/operationICD")
	public String operationICD(){
		return "statics/operationICD";
	}
	//手术编码
	@RequestMapping("/operationCode")
	public String operationCode(){
		return "statics/operationCode";
	}
	
	//设置假日
	@RequestMapping("/setHoliday")
	public String setHoliday(){
		return "statics/setHoliday";
	}
	
	
	
	//首页数据直报
	@RequestMapping("/indexpageInfo")
	public String indexpageInfo(){
		return "statics/indexpageInfo";
	}

	
	//质量统计
	@RequestMapping("/qualitystatistics")
	public String qualityCount(){
		return "statics/statistics/qualitystatistics";
	}

	//医师统计
	@RequestMapping("/doctorstatistics")
	public String doctorCount(){
		return "statics/statistics/doctorstatistics";
	}
	
	//国内病人来源
	@RequestMapping("/domesticpatient")
	public String domesticpatient(){
		return "statics/Sourceofpatients/domesticpatient";
	}
	//省内病人来源
	@RequestMapping("/provincePatient")
	public String provincePatient(){
		return "statics/Sourceofpatients/provincePatient";
	}
	//县区病人来源
	@RequestMapping("/countyPatient")
	public String countyPatient(){
		return "statics/Sourceofpatients/countyPatient";
	}
	//入院途径构成
	@RequestMapping("/inhospitalRoute")
	public String inhospitalRoute(){
		return "statics/Sourceofpatients/inhospitalRoute";
	}
	//从事职业构成
	@RequestMapping("/occupation")
	public String occupation(){
		return "statics/Sourceofpatients/occupation";
	}
	//入院状况构成
	@RequestMapping("/inhospitalStatus")
	public String inhospitalStatus(){
		return "statics/Sourceofpatients/inhospitalStatus";
	}
	//付费方式构成
	@RequestMapping("/paymentMode")
	public String paymentMode(){
		return "statics/Sourceofpatients/paymentMode";
	}
	
	//诊治疾病顺位
	@RequestMapping("/diagnosisDisease")
	public String diagnosisDisease(Model model){
		Map<String, List<java.util.Map<String, Object>>> map=medRecordService.getBaseInfoMap();
		if(MapUtils.isNotEmpty(map)){
			System.out.println(map.get("offices"));
			model.addAttribute("officeList",map.get("offices"));
		}
		return "statics/diseaseRecord/diagnosisDisease";
	}
	//死亡原因顺位
	@RequestMapping("/causeofDeath")
	public String causeofDeath(){
		return "statics/diseaseRecord/causeofDeath";
	}
	//住院手术顺位
	@RequestMapping("/inhospitalOperation")
	public String inhospitalOperation(Model model){
		Map<String, List<java.util.Map<String, Object>>> map=medRecordService.getBaseInfoMap();
		if(MapUtils.isNotEmpty(map)){
			System.out.println(map.get("offices"));
			model.addAttribute("officeList",map.get("offices"));
		}
		
		return "statics/diseaseRecord/inhospitalOperation";
	}
	//输血记录顺位
	@RequestMapping("/transfusionRecord")
	public String transfusionRecord(){
		return "statics/diseaseRecord/transfusionRecord";
	}
	

	//主要诊断审核
	@RequestMapping("/mainDiagnosisAudit")
	public String mainDiagnosisAudit(Model model){
		Map<String, List<java.util.Map<String, Object>>> map=medRecordService.getBaseInfoMap();
		if(MapUtils.isNotEmpty(map)){
			model.addAttribute("officeList",map.get("offices"));
		}
		return "statics/indexAudit/mainDiagnosisAudit";
	}
	
	
	//主要诊断审核
	@RequestMapping("/medicalRepaired")
	public String medicalRepaired(Model model){
		Map<String, List<java.util.Map<String, Object>>> map=medRecordService.getBaseInfoMap();
		if(MapUtils.isNotEmpty(map)){
			model.addAttribute("officeList",map.get("offices"));
		}
		return "statics/indexAudit/medicalRepaired";
	}
	
	
	//门诊诊断审核outpatientAudit
	@RequestMapping("/outpatientAudit")
	public String outpatientAudit(){
		return "statics/indexAudit/outpatientAudit";
	}
	//损伤编目审核damageCatalogueAudit
	@RequestMapping("/damageCatalogueAudit")
	public String damageCatalogueAudit(){
		return "statics/indexAudit/damageCatalogueAudit";
	}
	//肿瘤编目审核tumorCatalogingAudit
	@RequestMapping("/tumorCatalogingAudit")
	public String tumorCatalogingAudit(){
		return "statics/indexAudit/tumorCatalogingAudit";
	}
	//重复编目审核repeatedCataloging
	@RequestMapping("/repeatedCataloging")
	public String repeatedCataloging(){
		return "statics/indexAudit/repeatedCataloging";
	}
	//住院天数审核inhospitalDayAudit
	@RequestMapping("/inhospitalDayAudit")
	public String inhospitalDayAudit(){
		return "statics/indexAudit/inhospitalDayAudit";
	}
	//住院次数审核inhospitalNextAudit
	@RequestMapping("/inhospitalNextAudit")
	public String inhospitalNextAudit(){
		return "statics/indexAudit/inhospitalNextAudit";
	}
	//住院费用审核inhospitalMoneyAudit
	@RequestMapping("/inhospitalMoneyAudit")
	public String inhospitalMoneyAudit(Model model){
		Map<String, List<java.util.Map<String, Object>>> map=medRecordService.getBaseInfoMap();
		if(MapUtils.isNotEmpty(map)){
			model.addAttribute("officeList",map.get("offices"));
		}
		return "statics/indexAudit/inhospitalMoneyAudit";
	}
	//出生体重审核birthWeightAudit
	@RequestMapping("/birthWeightAudit")
	public String birthWeightAudit(){
		return "statics/indexAudit/birthWeightAudit";
	}
	//新生儿体重审核newbornWeightAudit
	@RequestMapping("/newbornWeightAudit")
	public String newbornWeightAudit(){
		return "statics/indexAudit/newbornWeightAudit";
	}
	//出身日期审核dateofbirthAudit
	@RequestMapping("/dateofbirthAudit")
	public String dateofbirthAudit(Model model){
		Map<String, List<java.util.Map<String, Object>>> map=medRecordService.getBaseInfoMap();
		if(MapUtils.isNotEmpty(map)){
			model.addAttribute("officeList",map.get("offices"));
		}
		return "statics/indexAudit/dateofbirthAudit";
	}
	//手术时间审核operationDateAudit
	@RequestMapping("/operationDateAudit")
	public String operationDateAudit(){
		return "statics/indexAudit/operationDateAudit";
	}
	//重复记录审核repeatRecordingAudit
	@RequestMapping("/repeatRecordingAudit")
	public String repeatRecordingAudit(){
		return "statics/indexAudit/repeatRecordingAudit";
	}
	//婚姻状况审核maritalStatusAudit
	@RequestMapping("/maritalStatusAudit")
	public String maritalStatusAudit(){
		return "statics/indexAudit/maritalStatusAudit";
	}

	//首页数据直报
	@RequestMapping("/indexDataDirectReport")
	public String indexDataDirectReport() {
		return "statics/indexCaseReport/indexDataDirectReport";
	}

	

	

	//医院质量监测
	@GetMapping("/hospitalQualityMonitoring")
	public String hospitalQualityMonitoring() {
		return "statics/indexCaseReport/hospitalQualityMonitoring";
	}
	
	//质量监测报表
	@GetMapping("/qualityMonitoringReport")
	public String qualityMonitoringReport() {
		return "statics/indexCaseReport/qualityMonitoringReport";
	}
	
	//医疗服务评价
	@GetMapping("/medicalServiceEvaluation")
	public String medicalServiceEvaluation() {
		return "statics/indexCaseReport/medicalServiceEvaluation";
	}
	

	
	//全文检索
	@GetMapping("/fullTextSearch")
	public String fullTextSearch() {
		return "query/fullTextSearch";
	}
	
	
	@RequestMapping("/medManage")
	public String medManage(){
		return "medManage/medManage";
	}
	
	
	@RequestMapping("/autoCatalogCheck")
	public String autoCatalogCheck(){
		return "statics/autoCatalogCheck";
	}
	
	
	@RequestMapping("/autoCatalogCheck2")
	public String autoCatalogCheck2(){
		return "statics/autoCatalogCheck2";
	}
	
	
	@RequestMapping("/medQua")
	public String medQua(){
		return "statics/medQua";
	}




}
